package com.ztesoft.web.common.controller;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.ui.Model;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.bind.annotation.ResponseBody;

import com.ztesoft.framework.exception.BaseAppException;
import com.ztesoft.web.common.db.po.DbNodePO;
import com.ztesoft.web.common.service.IDbInfoService;

/**
 * <Description>数据库信息<br>
 * 
 * @author lin.jie <br>
 * @version 1.0<br>
 * @taskId <br>
 * @CreateDate 2015年8月27日 <br>
 * @since V1.0<br>
 * @see com.ztesoft.web.common.controller <br>
 */

@Controller
@RequestMapping("/common/dbInfo")
public class DbInfoController {

	@Autowired
	private IDbInfoService dbInfoService;

	@RequestMapping("index")
	public String index(Model model) {
		return "baseconfig/jsp/dmPlan";
	}

	@RequestMapping("queryAllForTree")
	@ResponseBody
	public DbNodePO[] queryAllForTree() throws BaseAppException {
		DbNodePO[] resultArray = dbInfoService.queryAllForTree();
		return resultArray;
	}
}
